<?php echo form_open('admin/pages/form/'.$id); ?>

<div class="tabbable">
	
	<ul class="nav nav-tabs">
		<li class="active"><a href="#content_tab" data-toggle="tab">Nội dung</a></li>
		<li><a href="#attributes_tab" data-toggle="tab">Thuộc tính</a></li>
		<li><a href="#seo_tab" data-toggle="tab">Seo</a></li>
	</ul>
	
	<div class="tab-content">
		<div class="tab-pane active" id="content_tab">
			<fieldset>
				<label for="title">Tiêu đề</label>
				<?php
				$data	= array('name'=>'title', 'value'=>set_value('title', $title), 'class'=>'span12');
				echo form_input($data);
				?>
				
				<label for="content">Nội dung</label>
				<?php
				$data	= array('id'=>'content','name'=>'content', 'class'=>'ckeditor', 'value'=>set_value('content', $content));
				echo form_textarea($data);
				// echo display_ckeditor($ckeditor);
				?>
			</fieldset>
			<script type="text/javascript">
				jQuery(function(){
					// jQuery( 'textarea.ckeditor' ).ckeditor();
					CKEDITOR.replace( 'content', {
						filebrowserBrowseUrl: '/browser/browse.php',
						filebrowserUploadUrl: '/uploader/upload.php'
					});
					
				});
			</script>
		</div>

		<div class="tab-pane" id="attributes_tab">
			<fieldset>
				<label for="menu_title">Tiêu đề</label>
				<?php
				$data	= array('name'=>'menu_title', 'value'=>set_value('menu_title', $menu_title), 'class'=>'span5');
				echo form_input($data);
				?>
			
				<label for="slug">Slug</label>
				<?php
				$data	= array('name'=>'slug', 'value'=>set_value('slug', $slug), 'class'=>'span5');
				echo form_input($data);
				?>
			
				<label for="sequence">Thứ tự</label>
				<?php
				$data	= array('name'=>'sequence', 'value'=>set_value('sequence', $sequence), 'class'=>'span5');
				echo form_input($data);
				?>
			</fieldset>
		</div>
	
		<div class="tab-pane" id="seo_tab">
			<fieldset>
				<label for="code">Tiêu đề</label>
				<?php
				$data	= array('name'=>'seo_title', 'value'=>set_value('seo_title', $seo_title), 'class'=>'span12');
				echo form_input($data);
				?>
			
				<label>Meta</label>
				<?php
				$data	= array('rows'=>'3', 'name'=>'meta', 'value'=>set_value('meta', html_entity_decode($meta)), 'class'=>'span12');
				echo form_textarea($data);
				?>
				
				<p class="help-block">Vd: &lt;meta name="description" content="We sell products that help you" /&gt;</p>
			</fieldset>
		</div>
	</div>
</div>

<div class="form-actions">
	<button type="submit" class="btn btn-primary">Cập nhật</button>
</div>	
</form>